package com.zysc.processflow.service;

import com.zysc.processflow.entity.Attachment;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.core.io.Resource;
import org.springframework.web.multipart.MultipartFile;

import java.nio.file.Path;
import java.util.List;
import java.util.stream.Stream;

/**
 * <p>
 * 附件表 服务类
 * </p>
 *
 * @author 正元智慧城市_
 * @since 2022-11-18
 */
public interface IAttachmentService extends IService<Attachment> {
    void init();

    String store(MultipartFile file, Long fileid) throws Exception;

    Stream<Path> loadAll() throws Exception;

    Path load(String filename);

    Resource loadAsResource(String filename) throws Exception;

    void deleteAll();

    Boolean deletefiles(List<String> relativepaht);

    Boolean UpdateLinkAttachment(Long linkid,String type,List<Attachment> attachments);

    List<Attachment> getFilesByLinkId(Long id);
}
